package com.example.rabbitmqdemo.consumer;

import com.example.rabbitmqdemo.config.RabbitMQConfig;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Service;

@Service
public class MessageConsumer {

    @RabbitListener(queues = RabbitMQConfig.QUEUE_NAME_1)
    public void receiveMessage(String message) {
        System.out.println("Received message from Queues1: " + message);
    }
    @RabbitListener(queues = RabbitMQConfig.QUEUE_NAME_2)
    public void receiveMessage2(String message) {
        System.out.println("Received message from Queues2: " + message);
    }
    @RabbitListener(queues = RabbitMQConfig.VIP_QUEUE)
    public void receiveMessage3(String message) {
        System.out.println("Received message from VIP: " + message);
    }
    @RabbitListener(queues = RabbitMQConfig.DLX_QUEUE)
    public void receiveDLXMessage(String message) {
        System.out.println("Received message from DLX: " + message);
    }
    @RabbitListener(queues = RabbitMQConfig.DELIVERY_QUEUE)
    public void receiveDelayedMessage(String message) {
        System.out.println("Received delayed message: " + message);
    }


}    